package org.dromara.commission.listener;

import lombok.extern.slf4j.Slf4j;
import org.dromara.commission.domain.vo.LzshCommissionListImportVo;
import org.dromara.commission.domain.vo.LzshCommissionListVo;
import org.dromara.commission.listener.redisPlus.RedisPlusImportListener;
import org.dromara.common.satoken.utils.LoginHelper;

/**
 * 系统用户自定义导入
 *
 * @author 小将lcz
 */
@Slf4j
public class LzshCommissionListImportListener extends RedisPlusImportListener<LzshCommissionListImportVo> {

    @Override
    public String key(LzshCommissionListImportVo data) {
        return data.getCol09();
    }

    @Override
    public void invokeBefore(LzshCommissionListImportVo data) {
        //写入租户id和创建者id，避免调用自动填充然后多线程环境下租户id分配不足出现注入警告
        data.setTenantId("000000");
        data.setCreateBy(LoginHelper.getUserId());
//        data.ACCESS = false;//拒绝通行，也就是不读取该条记录
    }

    @Override
    public void invokeAfter(LzshCommissionListImportVo data) {

    }
}
